import { queryLogList, queryLogininforList, queryMqttLogList, queryLogInfo, queryLogininforInfo, deleteLog, deleteLogininfor, deleteMqttLog } from '@/api/sys-log'

const state = {}

const mutations = {}

const actions = {
    queryLogList({ commit }, params) {
        return new Promise(resolve => {
            queryLogList(params).then(response => {
                resolve(response.data)
            });
        })
    },
    queryLogininforList({ commit }, params) {
        return new Promise(resolve => {
            queryLogininforList(params).then(response => {
                resolve(response.data)
            });
        })
    },
    queryMqttLogList({ commit }, params) {
        return new Promise(resolve => {
            queryMqttLogList(params).then(response => {
                resolve(response.data)
            });
        })
    },
    queryLogInfo({ commit }, id) {
        return queryLogInfo(id);
    },
    queryLogininforInfo({ commit }, id) {
        return queryLogininforInfo(id);
    },
    deleteLog({ commit }, id) {
        return deleteLog(id);
    },
    deleteLogininfor({ commit }, id) {
        return deleteLogininfor(id);
    },
    deleteMqttLog({ commit }, id) {
        return deleteMqttLog(id);
    }
}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}
